package com.cardgame.controller;

import com.cardgame.dao.ArchivalDao;
import com.cardgame.model.archival.Archival;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
import java.util.HashMap;

@RestController
@RequestMapping("/api/game")
public class GameController {
    private final Archival archival;

    public GameController(ArchivalDao archivalDao) {
        this.archival = archivalDao.getArchival();
    }

    @GetMapping("/progress")
    public Map<String, Object> getProgress() {
        Map<String, Object> response = new HashMap<>();
        response.put("level", archival.getProgress());
        return response;
    }

    @GetMapping("/money")
    public Map<String, Object> getMoney() {
        Map<String, Object> response = new HashMap<>();
        response.put("money", archival.getMoney());
        return response;
    }
} 